<?php
	$current_user = wp_get_current_user();
	function wp_get_user_roles_by_user_id( $user_id ) {
	    $user = get_userdata( $user_id );
	    return empty( $user ) ? array() : $user->roles;
	}
	$myrole = wp_get_user_roles_by_user_id( $current_user->ID );
	$usermeta = get_the_author_meta( 'add_user_role', $current_user->ID );
	//print_r($current_user);
	//print_r($myrole);
	include TEMPLATEPATH.'/orders/order-install-database.php'; 
	include TEMPLATEPATH.'/orders/process.php';
	
	if($myrole[0]=="administrator" && ($current_user->user_login=="admin" || $current_user->user_login=="dbthanhbinh"))
	{
			include TEMPLATEPATH.'/admins/index.php';
			require_once TEMPLATEPATH .'/incs/payments/paypal/payment_db.php';
			require_once TEMPLATEPATH .'/incs/payments/paypal/payments.php';
			require_once TEMPLATEPATH .'/incs/payments/paypal/paypal.php';
			include TEMPLATEPATH.'/orders/tour/tour-setting.php';		
			include TEMPLATEPATH.'/orders/hotel/hotel-setting.php';		
			include TEMPLATEPATH.'/orders/agents/travel-agent-setting.php';		
			include TEMPLATEPATH.'/orders/ticket/ticket-setting.php';		
			include TEMPLATEPATH.'/orders/visas/visa-setting.php';
	}
	else
	{
	//My remove
	add_action('admin_menu', 'remove_menus2', 102);
	function remove_menus2()
	{
		global $submenu;
		
		/*
		remove_menu_page( 'edit.php' ); // Posts
		remove_menu_page( 'upload.php' ); // Media
		remove_menu_page( 'link-manager.php' ); // Links
		remove_menu_page( 'edit-comments.php' ); // Comments
		//remove_menu_page( 'edit.php?post_type=page' ); // Pages
		remove_menu_page( 'plugins.php' ); // Plugins
		//remove_menu_page( 'themes.php' ); // Appearance
		remove_menu_page( 'users.php' ); // Users
		remove_menu_page( 'tools.php' ); // Tools
		//remove_menu_page('options-general.php'); // Settings
		*/
		remove_menu_page( 'themes.php' ); // Appearance
		remove_menu_page( 'plugins.php' ); // Plugins
		remove_menu_page( 'users.php' ); // Users
		remove_menu_page('options-general.php'); // Settings
		remove_menu_page( 'edit.php?post_type=page' ); // Pages
		/*
		remove_submenu_page ( 'themes.php', 'themes.php' ); // Appearance-->Themes
		remove_submenu_page ( 'themes.php', 'widgets.php' ); // Appearance-->Widgets
		remove_submenu_page ( 'themes.php', 'theme-editor.php' ); // Appearance-->Editor       
		remove_submenu_page ( 'options-general.php', 'options-general.php' ); // Settings->General
		remove_submenu_page ( 'options-general.php', 'options-writing.php' ); // Settings->writing
		remove_submenu_page ( 'options-general.php', 'options-reading.php' ); // Settings->Reading
		remove_submenu_page ( 'options-general.php', 'options-discussion.php' ); // Settings->Discussion
		remove_submenu_page ( 'options-general.php', 'options-media.php' ); // Settings->Media
		remove_submenu_page ( 'options-general.php', 'options-privacy.php' ); // Settings->Privacy
		*/               
	} 
		
		
		if($usermeta=="Tours")
			include TEMPLATEPATH.'/orders/tour/tour-setting.php';
		else if($usermeta=="Hotels")
			include TEMPLATEPATH.'/orders/hotel/hotel-setting.php';
		else if($usermeta=="Travel Agent")	
			include TEMPLATEPATH.'/orders/agents/travel-agent-setting.php';
		else if($usermeta=="Tickets")	
			include TEMPLATEPATH.'/orders/ticket/ticket-setting.php';
		else if($usermeta=="Visas")
			include TEMPLATEPATH.'/orders/visas/visa-setting.php';
	}